#!/usr/bin/env bash
# Copyright (c) 2021 The Toltec Contributors
# SPDX-License-Identifier: MIT

pkgnames=(rmservewacominput)
pkgdesc="Serve pen input on port 33333"
url=https://github.com/LinusCDE/rmWacomToMouse
pkgver=0.3.0-2
timestamp=2021-03-10T18:36Z
section="utils"
maintainer="Linus K. <linus@cosmos-ink.net>"
license=MIT
installdepends=(appmarkable)

image=base:v2.1
source=(
    https://github.com/LinusCDE/rmWacomToMouse/archive/fd1c5454b65f456f6e890b99109e50a8f576dad1.zip
    rmservewacominput.draft
    rmservewacominput-gui
)
sha256sums=(
    c2c15b519a8352a5b52e1b15154e4024acc423552c6cf7559c23fcb8beffcd56
    SKIP
    SKIP
)

build() {
    cd c_implementation
    CC=arm-linux-gnueabihf-gcc make
}

package() {
    install -D -m 755 "$srcdir"/c_implementation/rmServeWacomInput "$pkgdir"/opt/bin/rmservewacominput
    install -D -m 755 "$srcdir"/rmservewacominput-gui "$pkgdir"/opt/bin/rmservewacominput-gui
    install -D -m 644 "$srcdir"/rmservewacominput.draft "$pkgdir"/opt/etc/draft/rmservewacominput.draft
    install -D -m 644 "$srcdir"/icon.png "$pkgdir"/opt/etc/draft/icons/rmservewacominput.png
}
